<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../common/CheckLoginBackend.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<script type="text/javascript" src="../statics/js/jquery.js"></script>
	<title>二组牛逼</title>
</head>
<body>
	<%@include file="../common/Admin_Header.jsp"%>
	<div class="i_bg bg_color">
		<!--Begin 用户中心 Begin -->
		<div class="m_content">

			<%@include file="../common/Admin_left.jsp"%>


			<div class="m_right" id="content">
				<div class="mem_tit">修改用户</div>
				<script>
						function check() {
							var idReg = /^\d{18}$/;
							var phoneReg = /^1[0-9]{10}$/;
							var emailReg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
							if ($("#l_user").val() == "") {
								alert("用户名不能为空");
								return false;
							} else if ($("#l_mem").val() == "") {
								alert("姓名不能为空");
								return false;
							} else if (!idReg.test($("#l_num").val())) {
								alert("身份证号格式不正确");
								return false;
							} else if (!emailReg.test($("#l_email").val())) {
								alert("邮箱合适不正确");
								return false;
							} else if (!phoneReg.test($("#l_phone").val())) {
								alert("手机号格式不正确");
								return false;
							}
							return true;
						}
				</script>
				<br>
					<form action="UserListServlet?action=updateSubmit" method="post" onsubmit="return check()">
						<table border="0" class="add_tab" style="width:930px;"
							cellspacing="0" cellpadding="0">
							<input type="hidden" name="id" value="${user.id}">
								<tr>
									<td align="right">分类名称</td>
									<td><input type="text" id="l_user" name="l_user"
										value="${user.loginName}" /> <span id="l_usertext"
										style="color:red;"></span>
									</td>
								</tr>
								<tr>
									<td align="right">真实姓名</td>
									<td><input type="text" id="l_mem" name="l_mem"
										value="${user.userName}" />
									</td>
								</tr>
								<tr>
									<td align="right">身份证号</td>
									<td><input type="text" id="l_num" name="l_num"
										value="${user.identityCode}" />
									</td>
								</tr>
								<tr>
									<td align="right">电子邮箱</td>
									<td><input type="text" id="l_email" name="l_email"
										value="${user.email}" />
									</td>
								</tr>
								<tr>
									<td align="right">手机</td>
									<td><input type="text" id="l_phone" name="l_phone"
										value="${user.mobile}" />
									</td>
								</tr>
								<tr>
									<td align="right">类型</td>
									<td><select name="l_type">
											<option value="0"
												<c:if test="${user.type==0}">selected='selected'</c:if>>管理员</option>
											<option value="1"
												<c:if test="${user.type==1}">selected='selected'</c:if>>用户</option>
									</select>
									</td>
								</tr>

								<tr>
									<td></td>
									<td><input type="submit" value="确定修改" class="s_btn" />
									</td>
								</tr>
						</table>
					</form>
			</div>
		</div>

	</div>
</body>
</html>


